package com.huluobo.a2302mdmdemo.demo

import android.util.Log
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Close
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.ElevatedButton
import androidx.compose.material3.Icon
import androidx.compose.material3.OutlinedButton
import androidx.compose.material3.OutlinedIconButton
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp

/**
 *  Created by LC on 2025/7/18.
 */

@Composable
fun MyButton() {
    Column(modifier = Modifier.padding(10.dp), verticalArrangement = Arrangement.spacedBy(10.dp)) {
        Button(
            onClick = {
                Log.e("TagA", "点击了按钮")
            }, modifier = Modifier
                .size(140.dp)
                .clip(CircleShape),
            //修改按钮的颜色
            colors = ButtonDefaults.buttonColors(
                //容器的颜色
                containerColor = Color.Red,
                //内容的颜色
                contentColor = Color.Black,
                //不可点击时内容的颜色
                disabledContentColor = Color.Blue,
                //不可点击时容器的 颜色
                disabledContainerColor = Color.Green
            ),
            enabled = false
        ) {
            Text(text = "Button")
        }
        OutlinedButton(onClick = {}) {
            Text(text = "OutlinedButton")
        }

        ElevatedButton(onClick = {}) {
            Text(text = "ElevatedButton")
        }

        TextButton(onClick = {}) {
            Text(text = "TextButton")
        }

        OutlinedIconButton(onClick = {}) {
            Icon(imageVector = Icons.Default.Close, contentDescription = "")
        }
    }
}